<template>
    <div class="container">
        <h1>测试页面</h1>
        <button @click="onClick">回到首页</button>
    </div>
</template>

<script setup>
import { useRouter, useRoute } from "vue-router";
const router = useRouter();
const route = useRoute();
const { age, ag } = history.state
console.log('传递的参数', route.params);
console.log('传递的参数', age, ag);
const onClick = () => {
    router.push('/');
}
</script>

<style lang="scss" scoped></style>